package com.zutassociation.system.service.impl;

import com.zutassociation.system.domain.Activity;
import com.zutassociation.system.mapper.ActivityMapper;
import com.zutassociation.system.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 活动 服务层实现
 *
 * @author 黄玉东
 * @version 1.0
 * @date 2021/3/18 17:15
 */
@Service
public class ActivityServiceImpl implements ActivityService {

    @Autowired
    private ActivityMapper activityMapper;

    /**
     * 查询活动信息
     *
     * @param activityId 活动ID
     * @return 活动信息
     */
    @Override
    public Activity selectActivityById(Long activityId) {
        return activityMapper.selectActivityById(activityId);
    }

    @Override
    public Activity selectUpActivity(Long activityId) {
        return activityMapper.selectUpActivity(activityId);
    }

    @Override
    public Activity selectNextActivity(Long activityId) {
        return activityMapper.selectNextActivity(activityId);
    }

    @Override
    public List<Activity> selectActivityListClick(Activity activity) {
        return activityMapper.selectActivityListClick(activity);
    }

    /**
     * 查询活动列表
     *
     * @param activity 活动信息
     * @return 活动集合
     */
    @Override
    public List<Activity> selectActivityList(Activity activity) {
        return activityMapper.selectActivityList(activity);
    }

    /**
     * 新增活动
     *
     * @param activity 活动信息
     * @return 结果
     */
    @Override
    public int insertActivity(Activity activity) {
        return activityMapper.insertActivity(activity);
    }

    /**
     * 修改活动
     *
     * @param activity 活动信息
     * @return 结果
     */
    @Override
    public int updateActivity(Activity activity) {
        return activityMapper.updateActivity(activity);
    }

    @Override
    public int updateActivityClick(Activity activity) {
        return activityMapper.updateActivityClick(activity);
    }

    /**
     * 删除活动信息
     *
     * @param activityId 活动ID
     * @return 结果
     */
    @Override
    public int deleteActivityById(Long activityId) {
        return activityMapper.deleteActivityById(activityId);
    }

    /**
     * 批量删除活动信息
     *
     * @param activityIds 需要删除的活动ID
     * @return 结果
     */
    @Override
    public int deleteActivityByIds(Long[] activityIds) {
        return activityMapper.deleteActivityByIds(activityIds);
    }
}
